import axios from 'axios';

const api = axios.create({
    baseURL: 'https://jsonplaceholder.typicode.com', // 这里换成你的后端 API 地址
    timeout: 5000
});

// 示例 API 调用
export const fetchPosts = () => api.get('/posts');
export const fetchPostById = (id) => api.get(`/posts/${id}`);

export default api;
